#/bin/sh
echo "Creating symbolic link ..."
rm -f web/sfDoctrineCultureFlagsPlugin web/sfDoctrinePlugin web/sfFormExtraPlugin
ln -s ../plugins/sfDoctrineCultureFlagsPlugin/web web/sfDoctrineCultureFlagsPlugin
ln -s ../lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/web web/sfDoctrinePlugin
ln -s ../plugins/sfFormExtraPlugin/web web/sfFormExtraPlugin

echo "Creating log and cache directories ..."
mkdir log
mkdir cache
chmod 777 log cache

echo "Clearing the cache ..."
symfony cc

echo "Creating tables in the database ..."
mysql makethetouch -u makethetouch --password=makethetouch < data/sql/schema.sql

echo "Injecting initial data ..."
symfony doctrine:data-load
